package org.example.mall.admin.model.entity.manage;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 字典项值
 * </p>
 *
 * @author hzq
 * @since 2022-01-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_dict_item")
@ApiModel(value="SysDictItem对象", description="字典项值")
public class SysDictItem extends Model<SysDictItem> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "字典项id")
    @TableId(value = "dict_item_id", type = IdType.AUTO)
    private Integer dictItemId;

    @NotNull(message = "字典类型id不能为空")
    @ApiModelProperty(value = "字典类型id")
    @TableField("dict_id")
    private Integer dictId;

    @NotBlank(message = "值不能为空")
    @ApiModelProperty(value = "值")
    @TableField("value")
    private String value;

    @NotBlank(message = "标签不能为空")
    @ApiModelProperty(value = "标签")
    @TableField("label")
    private String label;

    @NotBlank(message = "类型不能为空")
    @ApiModelProperty(value = "类型")
    @TableField("type")
    private String type;

    @ApiModelProperty(value = "描述")
    @TableField("description")
    private String description;

    @ApiModelProperty(value = "排序")
    @TableField("sort")
    private String sort;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField("update_time")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private LocalDateTime updateTime;


    @Override
    protected Serializable pkVal() {
        return this.dictItemId;
    }

}
